package com.example.demo.controller;

import com.example.demo.pojo.Bosses;
import com.example.demo.service.BossesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/boss")
public class BossesController {

    @Autowired
    private BossesService bossesService;

    @RequestMapping("/query")
    public List<Bosses> query(Integer startIndex, Integer pageSize){
        System.out.println("Controller进来了");
        System.out.println(startIndex);
        System.out.println(pageSize);
        System.out.println(bossesService.query(startIndex,pageSize));
        List<Bosses> list = bossesService.query(startIndex,pageSize);
        return list;
    }

}
